Scripts
Функции
create_spatial
ObjectPtr create_spatial(int scriptID, int tile, int elevation, int radius)
Creates new spatial script with given SID, at given tile, and radius.
get_script
int get_script(ObjectPtr)
- accepts a pointer to an object and returns its scriptID (line number in
scripts.lst
), or 0 if the object is unscripted. - returns -1 on argument error.
remove_script
void remove_script(ObjectPtr)
Accepts a pointer to an object and will remove the script from that object.
set_script
void set_script(ObjectPtr, int scriptid)
Accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid
from sfall 3.6). If used on an object that is already scripted, it will remove the existing script first; you cannot have multiple scripts attached to a single object. Calling set_script
on self_obj
will have all sorts of wacky side effects, and should be avoided. If you add 0x80000000 to the sid when calling set_script
, map_enter_p_proc
will be SKIPPED. The start
proc will always be run.
spatial_radius
funcX
int spatial_radius(ObjectPtr obj)
Returns radius of spatial script, associated with given dummy-object (returned by create_spatial
).